.chat-box {
  // min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background-color);
  color: var(--text-color);
  // 为了解决滚动条问题
  width: 100%;
  height: 100%;
  overflow: auto;
  position: absolute; /* 或 fixed */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

// 聊天框
.chat-footer-action-box {
  display: flex;
  flex-direction: column;
  background: var(--background-color);
  padding: 10px 0;
  z-index: 10;
}
.chat-input-component {
  flex-direction: column;
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 6px 6px 0 6px;
  // margin-bottom: -1px;
  border: 1px solid var(--dark-border-color);
  background-color: var(--background-color);
  color: var(--text-color);
  .ant-input {
    border-radius: 8px;
    padding: 8px 0;
    border: none;
    color: var(--text-color);
    &::placeholder {
      color: var(--text-color); /* 暗色主题 */
    }
  }

  .chat-action-box {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    button {
      color: var(--text-color);
      background-color: var(--background-color);
    }
    button:hover {
      background-color: var(--background-color) !important;
    }
    button:active {
      background-color: var(--background-color) !important;
      color: var(--text-color) !important;
      border-color: var(--border-color) !important;
    }
    button:focus-visible {
      outline: none;
    }

    // 操作区
    .chat-action-box-model {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;

      .chat-action-box-model-model {
        // border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 12px;
        padding: 4px;
        cursor: pointer;
        color: var(--text-color);
        margin-right: 8px;
      }
      .chat-action-box-model-image {
        // border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 12px;
        padding: 4px;
        cursor: pointer;
        color: var(--text-color);
      }
    }
  }

  .chat-submit-btn {
    /* 确保按钮有足够宽度显示文字 */
    width: 80px;
    height: 20px;
    // padding: 0 16px;
    line-height: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--border-radius);
  }
  .ant-btn-dangerous {
    background-color: #ff4d4f;
    // border-color: #ff4d4f;
    border: none;
  }
  .ant-btn-dangerous:hover {
    background-color: #ff7875;
    // border-color: #ff7875;
    border: none;
  }
  .ant-input[disabled] {
    background-color: var(--background-color);
    cursor: not-allowed;
    border: none;
  }
  // 按钮悬浮
  :where(.css-dev-only-do-not-override-1kf000u).ant-btn-variant-outlined:not(
      :disabled
    ):not(.ant-btn-disabled):hover,
  :where(.css-dev-only-do-not-override-1kf000u).ant-btn-variant-dashed:not(
      :disabled
    ):not(.ant-btn-disabled):hover {
    color: var(--text-color);
    border: 1px solid var(--border-color);
  }
  // 整体输入框背景色
  :where(.css-dev-only-do-not-override-1kf000u).ant-input-outlined {
    background-color: var(--background-color);
    // border: 1px solid var(--dark-border-color);
  }
  :where(.css-dev-only-do-not-override-1kf000u).ant-input-outlined:focus,
  :where(
      .css-dev-only-do-not-override-1kf000u
    ).ant-input-outlined:focus-within {
    box-shadow: none;
  }

  .closeIconShow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(214, 214, 221, 1);
  }
  .closeExpanded {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    // padding: 8px;
    text-align: center;
    cursor: pointer;
    color: rgba(214, 214, 221, 1);
  }
}
.chat-input-component-title {
  text-align: left;
  font-size: var(--font-size-small);
  line-height: 16px;
  font-weight: bold;
  // padding: 10px;
  // 路径栏下的traceId展示
  display: flex;
  flex-direction: row;
  // align-items: center;

  .chat-input-component-title-text-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 100px;
    // line-height: 16px;
    height: 20px;
    line-height: 20px;
    cursor: pointer;
  }

  .chat-input-component-title-text {
    display: flex;
    flex-direction: row;
    align-items: left;
    justify-content: space-between;
    min-width: 80px;
    margin-right: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
  }

  .chat-input-component-title-traceId-box {
    // 只能在视野内展示，超出距离自动换行排列，高度无限制
    flex: 1;
    max-width: 80%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    // text-overflow: ellipsis;
    // white-space: nowrap;
  }

  .chat-input-component-title-traceId {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    // line-height: 16px;
    height: 20px;
    line-height: 20px;
    padding: 0 4px;
    margin: 0 4px 4px 0;
    cursor: pointer;
  }
  .chat-input-component-title-traceId-active {
    cursor: pointer;
    border: 1px solid orange;
  }

  .chat-input-component-title-text-add-box {
    border: 1px solid var(--border-color);
  }
}

// //  下面聊天框
// .chat-input-component-bottom {
//   border-radius: 8px 8px 0 0;
//   position: fixed;
//   bottom: 0;
//   left: 0;
//   right: 0;
//   margin: 0 10px 0px 10px;
//   // 底部呈现蒙版的效果，看不到下层内容
//   background: rgba(255, 255, 255, 1);
// }

// 聊天框的代码块
.chat-input-component-title-code-box {
  position: relative;
}

.chat-content-item-content-empty {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  // margin: 0 10px 0px 10px;
  // 底部呈现蒙版的效果，看不到下层内容
  background: rgba(255, 255, 255, 1);
}

// 展示内容
.chat-content-item-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  // padding-bottom: 300px;
}

.inputContainer {
  display: flex;
  flex-direction: column;
  padding: 5px 16px 5px 16px;
  // background: white;
  // border-top: 1px solid #f0f0f0;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  .ant-input {
    border-radius: var(--border-radius);
    padding: 8px 16px;
  }

  .chat-content-item-content-user-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 95%;
    .chat-content-item-content-user-text-content {
      flex: 1;
      // 决定输出文案的排列
      // display: flex;
      // flex-direction: column;
      text-align: left;
      line-height: 30px;
      gap: 8px;
    }
  }
  .chat-content-item-content-time {
    text-align: right;
    font-size: var(--font-size-small);
    color: var(--text-color);
  }
  p {
    margin: 0;
    font-size: var(--font-size);
    text-align: left;
  }
  h1,
  h2,
  h3,
  h4,
  h5 {
    text-align: left;
    margin: 0;
    padding: 0;
  }

  span {
    font-size: var(--font-size);
    display: inline !important;
    text-align: left !important;
  }
  .code-block {
    .code-block-title {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      line-height: 14px;
      font-size: 13px;
      color: var(--text-color);
    }
    .code-block-title-copy {
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    &:hover {
      .code-block-title-copy {
        opacity: 1;
      }
    }
  }
}
.user {
  margin-top: 10px;
  border-radius: var(--border-radius);
  // border: 1px solid var(--border-color);
  background: var(--user-background-color);
}

// 其他样式
// 代码展示
.code-display {
  .ant-typography-expand,
  .ant-typography-copy {
    margin-left: 8px;
  }

  &.ant-typography-ellipsis-multiple-line {
    max-height: none !important;
  }

  // 禁止编辑，但允许选中
  -webkit-user-modify: read-only;
  -moz-user-modify: read-only;
  // user-modify: read-only;
}

// 复制模块
.chat-content-item-content-user-text-copy {
  // text-align: right;
  position: absolute;
  right: -8%;
  top: 0;
  font-size: 14px;
  opacity: 0;
  cursor: pointer;
  color: var(--text-color);
  transition: opacity 0.3s ease;
}

// 文本展示
.chat-content-item-content-text-content {
  position: relative;
  &:hover {
    .chat-content-item-content-user-text-copy {
      opacity: 1;
    }
  }
}

// 用户输入框定制
.chat-content-item-content-user-text-content {
  position: relative;
  .chat-content-item-content-user-text-copy-title {
    // text-align: right;
    position: absolute;
    right: -8%;
    top: 0;
    font-size: 14px;
    opacity: 0;
    cursor: pointer;
    color: var(--text-color);
    transition: opacity 0.3s ease;
  }

  &:hover {
    .chat-content-item-content-user-text-copy-title {
      opacity: 1;
    }
  }
}
// .ant-dropdown {
//   .ant-dropdown-menu {
//     background-color: var(--background-color) !important;
//     color: var(--text-color) !important;
//     // 如果需要修改hover状态的背景色
//     .ant-dropdown-menu-item:hover {
//       background-color: var(--background-color) !important;
//     }

//     // 如果需要修改文字颜色
//     .ant-dropdown-menu-item {
//       color: var(--text-color) !important;
//     }
//   }
// }
